import instance from "@/http/index"

// 获取用户信息
export const getUserInfo = data => {
    return instance({
        url: "/user/getUserInfo",
        method: "POST",
        data
    })
}

// 修改姓名
export const changeName = data => {
    return instance({
        url: "/user/changeName",
        method: "POST",
        data
    })
}

// 修改性别
export const changeSex = data => {
    return instance({
        url: "/user/changeSex",
        method: "POST",
        data
    })
}

// 修改邮箱
export const changeEmail = data => {
    return instance({
        url: "/user/changeEmail",
        method: "POST",
        data
    })
}

// 修改密码
export const changePassword = data => {
    return instance({
        url: "/user/changePassword",
        method: "POST",
        data
    })
}

// 上传头像
export const uploadAvatar = data => {
    return instance({
        url: "/user/uploadAvatar",
        method: "POST",
        data
    })
}

// 绑定账号
export const bindAccount = data => {
    return instance({
        url: "/user/bindAccount",
        method: "POST",
        data
    })
}

// -----------用户管理

export const createAdmin = data => {
    return instance({
        url: "/user/createAdmin",
        method: "POST",
        data
    })
}

export const getAdminList = data => {
    return instance({
        url: "/user/getAdminList",
        method: "POST",
        data
    })
}

export const editAdmin = data => {
    return instance({
        url: "/user/editAdmin",
        method: "POST",
        data
    })
}

export const changeIdentity = data => {
    return instance({
        url: "/user/changeIdentity",
        method: "POST",
        data
    })
}

export const changeIdentityAdimin = data => {
    return instance({
        url: "/user/changeIdentityAdimin",
        method: "POST",
        data
    })
}

export const searchUser = data => {
    return instance({
        url: "/user/searchUser",
        method: "POST",
        data
    })
}

export const hotUser = data => {
    return instance({
        url: "/user/hotUser",
        method: "POST",
        data
    })
}

export const banUser = data => {
    return instance({
        url: "/user/banUser",
        method: "POST",
        data
    })
}

export const getBanList = data => {
    return instance({
        url: "/user/getBanList",
        method: "POST",
        data
    })
}

export const deleteUser = data => {
    return instance({
        url: "/user/deleteUser",
        method: "POST",
        data
    })
}